翻訳と辞書
Words near each other
・ Laïka Fatien
・ Laïko
・ Laïla Abid
・ Laïla Marrakchi
・ Laïs (band)
・ Laïs (physician)
・ Laïsa Lerus
・ Laïta
・ Laúd
・ Laüs
・ Lazy Eye (Silversun Pickups song)
・ Lazy Farmer (album)
・ Lazy Henry
・ Lazy Highways
・ Lazy inheritance
Lazy initialization
・ Lazy jack
・ Lazy Jay Ranch
・ Lazy Jones
・ Lazy Kate
・ Lazy Lake, Florida
・ Lazy Lamhe
・ Lazy learning
・ Lazy Lester
・ Lazy Line Painter Jane
・ Lazy Line Painter Jane (boxset)
・ Lazy linear hybrid automaton
・ Lazy Lion
・ Lazy loading
・ Lazy Love


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Lazy initialization : ウィキペディア英語版
Lazy initialization
In computer programming, lazy initialization is the tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed.
This is typically accomplished by augmenting a variable's accessor method (or property definition) to check for a previously-created instance. If none exists a new instance is created, placed into the variable, and this new object is returned to the caller in a just-in-time fashion. In this manner object creation is deferred until first use which can, in some circumstances (e.g., sporadic object access), increase system responsiveness and speed startup by bypassing large-scale object pre-allocation. (Note that this may have attendant counter-effects on overall performance, however, as the impact of object instantiation is then amortized across the startup/warm-up phase of the system.)
In multithreaded code, access to lazy-initialized objects/state must be synchronized to guard against a race condition.
See lazy evaluation for a general treatment of this idea. In heavily imperative languages this pattern carries hidden dangers, as does any programming habit that relies on shared state.
==The "lazy factory"==

In a software design pattern view, lazy initialization is often used together with a factory method pattern. This combines three ideas:
* Using a factory method to get instances of a class (factory method pattern)
* Store the instances in a map, so you get the ''same'' instance the next time you ask for an instance with ''same'' parameter (multiton pattern)
* Using lazy initialization to instantiate the object the first time it is requested (lazy initialization pattern)

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Lazy initialization」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.